﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using Runda.CMS.Common.Utility;
using Runda.CMS.Common.Entity;
using Runda.CMS.Bll;

namespace Runda.CMS.Portal.WorkFlow
{
    public partial class WFDefined_StepList : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                this.txtProcessGUID.Text = this.Request.QueryString["ModelID"];
                string str = @"Select  UserName as Name, '1' as 'RightValue' ,  ModelID ,A.ActivityType,convert(varchar(100),ActivityType) + '.1' as 'Code',0 as 'Type'  From Cms_Wfl_Activity A inner join Cms_Wfl_ActivityCheckers B on A.ActivityID = B.ActivityID Where A.ModelID = '"+txtProcessGUID.Text+"' Union All Select DISTINCT ( convert(VarChar(4),ActivityType) + ' ' + ActivityName + '[步骤类型:' + case when ActivityType=0 then '审批' else '汇签' end + ';  ') as Name , '' , ModelID,ActivityType ,convert(VarChar(100),ActivityType) as 'Code', -1 as 'Type'  From Cms_Wfl_Activity  Where ModelID = '"+txtProcessGUID.Text+"' Order by ModelID ,ActivityType,Code ";
                this.repeater1.BindMode = 0;               
                this.repeater1.SQL = str;
                this.repeater1.DataBind();
            }
        }
    }
}
